<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGoodsModeTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('goods_mode', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->timestamps();

            $table->integer('goods_id')->default(0)->unsigned()->comment('商品id');

            $table->string('mode')->default('')->comment('模型参数，json格式');


            $table->unique('goods_id');

        });

        DB::statement("ALTER TABLE `goods_mode` COMMENT='商品模型表'");//表注释
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('goods_mode');
    }
}
